<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ice:panelGroup xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                rendered="#{questionnaireController.page == 'diffusion'}"
                xmlns:h="http://java.sun.com/jsf/html">
    <ice:panelGroup styleClass="titreListeEtat">
        <ice:outputText value="#{bundle.diffusion}"/>
    </ice:panelGroup>

    <ice:panelGrid  columns="2">
        <ice:outputLabel value="#{bundle.QuestionnaireTitre}" for="titre" />
        <h:outputText  value="#{questionnaireController.questionnaire.titre}" />

        <ice:outputLabel value="#{bundle.QuestionnaireDateOuverture}" for="dateOuverture" />
        <ice:selectInputDate  popupDateFormat="dd/MM/yyyy HH:mm:ss" renderAsPopup="true"

                              value="#{questionnaireController.questionnaire.dateOuverture}"/>

        <ice:outputLabel value="#{bundle.QuestionnaireDateCloturer}" for="dateCloturer" />
        <ice:selectInputDate popupDateFormat="dd/MM/yyyy HH:mm:ss" renderAsPopup="true"
                             value="#{questionnaireController.questionnaire.dateCloturer}"/>
    </ice:panelGrid>

    <ice:panelGroup>
        <ice:panelPopup draggable="true" modal="false"  style="position: absolute"
                        rendered="#{diffusionController.affichePopup}"
                        visible="#{diffusionController.affichePopup}">
            <f:facet name="header">
                <ice:panelGroup styleClass="popupHeaderWrapper">
                    <ice:outputText value="#{bundle.utilisateursDeSelect}"
                                    styleClass="popupHeaderText"/>
                    <ice:commandButton id="draggablePnlCloseBtn" styleClass="popupHeaderImage"
                                       title="Close Popup" alt="Close" type="button"
                                       image="#{msgs['page.panelPopup.closeImage']}"
                                       actionListener="#{diffusionController.togglePopup}" />
                </ice:panelGroup>
            </f:facet>
            <f:facet name="body">
                <ice:panelGroup>
                    <ice:dataTable  id="u1" rows="8" columnClasses="tableCol"
                                    value="#{diffusionController.utilisateursNoSelected}" var="util1" >
                        <f:facet name="header">
                            <ice:columnGroup>
                                <ice:headerRow>
                                    <ice:column colspan="3"><ice:outputText value="#{bundle.utilisateursDeSelect}"/></ice:column>
                                </ice:headerRow>
                                <ice:headerRow>
                                    <ice:column><ice:outputText value="#{bundle.nom}"/> </ice:column>
                                    <ice:column><ice:outputText value="#{bundle.prenom}"/></ice:column>
                                    <ice:column><ice:outputText value="#{bundle.mail}"/></ice:column>
                                </ice:headerRow>
                            </ice:columnGroup>
                        </f:facet>
                        <ice:column>
                            <ice:rowSelector value="#{util1.selected}"
                                             selectionListener="#{diffusionController.rowSelectionListener2}" />
                            <ice:outputText value="#{util1.nom}"/>
                        </ice:column>
                        <ice:column><ice:outputText value="#{util1.prenom}"/></ice:column>
                        <ice:column><ice:outputText value="#{util1.mail}"/></ice:column>
                    </ice:dataTable>

                    <ice:dataPaginator id="dataScroll_1" for="u1" fastStep="3" paginator="true" paginatorMaxPages="4">
                        <f:facet name="first">
                            <ice:graphicImage id="firstpage_1" style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-first.gif"
                                              title="#{msgs['page.dataScrolling.firstpage']}"/>
                        </f:facet>
                        <f:facet name="last">
                            <ice:graphicImage id="lastpage_1" style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-last.gif"
                                              title="#{msgs['page.dataScrolling.lastpage']}"/>
                        </f:facet>
                        <f:facet name="previous">
                            <ice:graphicImage id="previouspage_1" style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-previous.gif"
                                              title="#{msgs['page.dataScrolling.previouspage']}"/>
                        </f:facet>
                        <f:facet name="next">
                            <ice:graphicImage id="nextpage_1"  style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-next.gif"
                                              title="#{msgs['page.dataScrolling.nextpage']}"/>
                        </f:facet>
                        <f:facet name="fastforward">
                            <ice:graphicImage id="fastforward_1"  style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-ff.gif"
                                              title="#{msgs['page.dataScrolling.fastforward']}"/>
                        </f:facet>
                        <f:facet name="fastrewind">
                            <ice:graphicImage id="fastrewind_1" style="border:none;"
                                              url="#{styleBean.imageDirectory}arrow-fr.gif"
                                              title="#{msgs['page.dataScrolling.fastbackward']}"/>
                        </f:facet>
                    </ice:dataPaginator>
                </ice:panelGroup>
            </f:facet>
        </ice:panelPopup>
    </ice:panelGroup>






    <ice:commandButton type="submit" value="Ajouter des participants aux questionnaires"
                       actionListener="#{diffusionController.togglePopup}"/>

    <ice:dataTable id="u2" rows="8" columnClasses="tableCol" style="width: 100%"
                   value="#{diffusionController.questionnaire.utilisateurs}" var="util2" >
        <f:facet name="header">
            <ice:columnGroup>
                <ice:headerRow>
                    <ice:column colspan="3"><ice:outputText value="#{bundle.utilisateursSelect}"/></ice:column>
                </ice:headerRow>
                <ice:headerRow>
                    <ice:column><ice:outputText value="#{bundle.nom}"/></ice:column>
                    <ice:column><ice:outputText value="#{bundle.prenom}"/></ice:column>
                    <ice:column><ice:outputText value="#{bundle.mail}"/></ice:column>
                </ice:headerRow>
            </ice:columnGroup>
        </f:facet>
        <ice:column>
            <ice:rowSelector value="#{util2.selected}"
                             selectionListener="#{diffusionController.rowSelectionListener}" />
            <ice:outputText value="#{util2.nom}"/>
        </ice:column>
        <ice:column><ice:outputText value="#{util2.prenom}"/></ice:column>
        <ice:column><ice:outputText value="#{util2.mail}"/> </ice:column>
    </ice:dataTable>
    <ice:dataPaginator id="dataScroll_2" for="u2" fastStep="3" paginator="true" paginatorMaxPages="4">
        <f:facet name="first">
            <ice:graphicImage id="firstpage_2"  style="border:none;"
                              url="#{styleBean.imageDirectory}arrow-first.gif"
                              title="#{msgs['page.dataScrolling.firstpage']}"/>
        </f:facet>
        <f:facet name="last">
            <ice:graphicImage id="lastpage_2"
                              url="#{styleBean.imageDirectory}arrow-last.gif"
                              style="border:none;"
                              title="#{msgs['page.dataScrolling.lastpage']}"/>
        </f:facet>
        <f:facet name="previous">
            <ice:graphicImage id="previouspage_2" style="border:none;"
                              url="#{styleBean.imageDirectory}arrow-previous.gif"
                              title="#{msgs['page.dataScrolling.previouspage']}"/>
        </f:facet>
        <f:facet name="next">
            <ice:graphicImage id="nextpage_2" style="border:none;"
                              url="#{styleBean.imageDirectory}arrow-next.gif"
                              title="#{msgs['page.dataScrolling.nextpage']}"/>
        </f:facet>
        <f:facet name="fastforward">
            <ice:graphicImage id="fastforward_2" style="border:none;"
                              url="#{styleBean.imageDirectory}arrow-ff.gif"
                              title="#{msgs['page.dataScrolling.fastforward']}"/>
        </f:facet>
        <f:facet name="fastrewind">
            <ice:graphicImage id="fastrewind_2" style="border:none;"
                              url="#{styleBean.imageDirectory}arrow-fr.gif"
                              title="#{msgs['page.dataScrolling.fastbackward']}"/>
        </f:facet>
    </ice:dataPaginator>

    <ice:commandButton action="#{diffusionController.diffuserQuestionnaire}" value="#{bundle.QuestionnaireDiffuser}" />







</ice:panelGroup>
